﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SuperStore.Models
{
    public static class Members
    {
        public static bool ValidMemberID(string memberID)
        {
            if (string.IsNullOrWhiteSpace(memberID))
            {
                return false;
            }

            try
            {
                Guid memberIDGuid = Guid.Parse(memberID);
                Member member = (from m in Database.Instance.Members
                                 where m.PK == memberIDGuid
                                 select m).Single();

                return true;
            }
            catch
            {
                return false;
            }            
        }
    }
}